using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace OrtzEng.Text
{
    public class Text
    {

        public Text(Vector2 thePosition, string theValue, int theSize)
        {
            Position = thePosition;
            Value = theValue;
            Size = theSize;
        }

        //The Position of the text
        private Vector2 mPosition = new Vector2(0);
        public Vector2 Position
        {
            get { return mPosition; }
            set { mPosition = value; }
        }

        //The Value of the text 
        private string mValue = string.Empty;
        public string Value
        {
            get { return mValue; }
            set { mValue = value; }
        }

        //The Size of the text
        private int mSize = -1;
        public int Size
        {
            get { return mSize; }
            set { mSize = value; }
        }

        private bool mVisible = true;
        public bool Visible
        {
            get { return mVisible; }
            set
            {
                mVisible = value;
                if (mVisible == true && VisibleTime != 0)
                {
                    //Reset the time for the image to be viisble
                    Elapsed = VisibleTime;
                }
            }
        }


        private float mVisibleTime = 0;
        public float VisibleTime
        {
            get { return mVisibleTime; }
            set { mVisibleTime = value; }
        }

        private float mElapsed = 0;
        public float Elapsed
        {
            get { return mElapsed; }
            set
            {
                mElapsed = value;
                if (mElapsed < 0)
                {
                    mElapsed = 0;
                    mVisible = false;
                }
            }
        }
    }
}
